class MyRunnable implements Runnable {
    @Override
    public void run() {
        int i = 1;
        while(i != 100) {
            System.out.println(i);
            i++;
        }
        System.out.println("t 线程结束");
    }
}

public class Threaddemo2 {
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new MyRunnable();
        Thread t = new Thread(runnable);
        t.start();
        t.join();
        System.out.println("mian 线程结束");
    }
}
